<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">


    <title>数据 - AdminLTE2定制版 | Log in</title>


    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <!-- Font Awesome -->
    <!-- Ionicons -->
    <!-- Theme style -->
    <!-- iCheck -->
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="./resources/plugins/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="./resources/plugins/font-awesome/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="./resources/plugins/ionicons/css/ionicons.min.css"/>
    <link rel="stylesheet" href="./resources/plugins/adminLTE/css/AdminLTE.css"/>
    <link rel="stylesheet" href="./resources/plugins/iCheck/square/blue.css"/>
	
</head>

<body class="hold-transition login-page">
<div class="login-box">


    <!-- /.login-logo -->
    <div class="login-box-body">
		<div class="login-logo">
		    <a href="all-admin-index.html"><b>小米企业</b>管理系统</a>
		</div>
        <p class="login-box-msg">登录系统</p>

        <form action="" method="post" id="form">
            <div class="form-group has-feedback">
                <input type="text" class="form-control" placeholder="用户名" name="username" required="required" value="">
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control" placeholder="密码" name="password" required="required" value="">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <!-- <div class="col-xs-8">
                    <div class="checkbox icheck">
                        <label><input type="checkbox" name="remember-me" value="true"> 记住 下次自动登录</label>
                    </div>
                </div> -->
                <!-- /.col -->
                <div class="col-xs-12">
                    <button type="button" id="loginbtn" class="btn btn-primary btn-block btn-flat" >登录</button>
                </div>
                <!-- /.col -->
            </div>
        </form>

        <!-- <div class="social-auth-links text-center">
            <p>- 或者 -</p>
            <a href="#" class="btn btn-block btn-social btn-facebook btn-flat"><i class="fa fa-qq"></i> 腾讯QQ用户登录</a>
            <a href="#" class="btn btn-block btn-social btn-google btn-flat"><i class="fa fa-weixin"></i> 微信用户登录</a>
        </div>

        <a href="#">忘记密码</a><br>
        <a href="#" class="text-center">新用户注册</a> -->

    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 2.2.3 -->
<!-- Bootstrap 3.3.6 -->
<!-- iCheck -->
<script src="./resources/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="./resources/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="./resources/plugins/iCheck/icheck.min.js"></script>
<script src="resources/js/userhandler.js" type="text/javascript" charset="utf-8"></script>
<script>
 

	function resultHandler(result){
		if (result.select == true){
			//登陆成功，跳转到11.html
			window.location.href = "admin-center.html";
			
		}else{
			//登陆失败，写出失败提醒
			alertResult(result);
			
		}
	} 

    $(document).ready(function() {
        $("#loginbtn").click(function(){
            $.ajax({
                url:"sysUser/login",
                type:"POST",
                data:$("#form").serialize(),
                dataType:"json",
                success:function(result){
					resultHandler(result);
                },
                error:function(xml,err){
                    console.log(err);
                }
            });
        });
		$('input').iCheck({
		    checkboxClass: 'icheckbox_square-blue',
		    radioClass: 'iradio_square-blue',
		    increaseArea: '20%' // optional
		});
    });
</script>
</body>

</html>